﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace LY.Manage.WebApp.Models
{
    public class MyExceptionAttribute : HandleErrorAttribute
    {

        /// <summary>
        /// 异常队列
        /// </summary>
        public static Queue<Exception> ExceptionQueue = new Queue<Exception>();


        public override void  OnException(ExceptionContext filterContext)
        {
            base.OnException(filterContext);

            //将异常信息添加都队列当中
            ExceptionQueue.Enqueue(filterContext.Exception);

            //
            filterContext.HttpContext.Response.Redirect("/Error.html");

        }

    }
}